﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
    public class Cat
    {
        private string name;
        private Host owner;
        public Host Owner
        {
            get { return this.owner; }
            set
            {
                this.owner = value;
                this.owner.OnGetup += new EventHandler(owner_OnGetup);
            }
        }
        public Cat(string name)
        {
            this.name = name;
        }
        private void owner_OnGetup(object sender, EventArgs e)
        {
            Console.WriteLine("{0}", name);
            Console.WriteLine("喵喵...主人起床了，我也该起了");
        }
    }
}
